import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { SysLoginlogComponent } from './loginlog/loginlog.component';
import { SysMenuComponent } from './menu/menu.component';
import { SysOperationRecordComponent } from './operation-record/operation-record.component';
import { SysPermissionComponent } from './permission/permission.component';
import { SysProfileBaseComponent } from './profile/base/base.component';
import { SysProfileComponent } from './profile/profile.component';
import { SysProfileSecurityComponent } from './profile/security/security.component';
import { SysAssignMenuComponent } from './role/assign/menu/menu.component';
import { SysAssignPermissionComponent } from './role/assign/permission/permission.component';
import { SysRoleComponent } from './role/role.component';
import { SysUserComponent } from './user/user.component';

const routes: Routes = [
  { path: 'permission', component: SysPermissionComponent },
  { path: 'role', component: SysRoleComponent },
  { path: 'menu', component: SysMenuComponent },
  { path: 'user', component: SysUserComponent },
  { path: 'operationRecord', component: SysOperationRecordComponent },
  { path: 'permission', component: SysAssignPermissionComponent },
  { path: 'menu', component: SysAssignMenuComponent },
  { path: 'loginlog', component: SysLoginlogComponent },
  {
    path: 'profile',
    component: SysProfileComponent,
    children: [
      { path: '', redirectTo: 'base', pathMatch: 'full' },
      {
        path: 'base',
        component: SysProfileBaseComponent
      },
      {
        path: 'security',
        component: SysProfileSecurityComponent
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class SysRoutingModule {}
